"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
from selenium.webdriver.common.by import By

from litemall.pages.base_page import BasePage

"""
首页
"""


class HomePage(BasePage):
    _MENU_PRODUCT_MANAGE = (By.XPATH, "//span[contains(text(), '商品管理')]")
    _MENU_PRODUCT_LAUNCH = (By.XPATH, "//span[contains(text(), '上架')]")

    def go_to_product_launch(self):
        # 点击“商品管理”菜单
        self.do_click(*self._MENU_PRODUCT_MANAGE)
        # 点击“商品上架”
        self.do_click(*self._MENU_PRODUCT_LAUNCH)
        # 进入商品上架页面
        from litemall.pages.product_launch_page import ProductLaunchPage
        return ProductLaunchPage(self.driver)
